public class Solution {
    public static void main(String[] args) {
        // write your code here

        for(int i=1;i<=1000;i++){
            int value = 0;
            for(int j=1;j<=i;j++){
                if(i%j==0&&i!=j){
                    value+=j;
                }
            }
            if (i==value){
                System.out.println(value);
            }
        }
    }
}
